#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["src/MyCompanyName.AbpZeroTemplate.Web.Mvc/MyCompanyName.AbpZeroTemplate.Web.Mvc.csproj", "src/MyCompanyName.AbpZeroTemplate.Web.Mvc/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.Web.Core/MyCompanyName.AbpZeroTemplate.Web.Core.csproj", "src/MyCompanyName.AbpZeroTemplate.Web.Core/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.Application/MyCompanyName.AbpZeroTemplate.Application.csproj", "src/MyCompanyName.AbpZeroTemplate.Application/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.Application.Shared/MyCompanyName.AbpZeroTemplate.Application.Shared.csproj", "src/MyCompanyName.AbpZeroTemplate.Application.Shared/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.Core.Shared/MyCompanyName.AbpZeroTemplate.Core.Shared.csproj", "src/MyCompanyName.AbpZeroTemplate.Core.Shared/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.Core/MyCompanyName.AbpZeroTemplate.Core.csproj", "src/MyCompanyName.AbpZeroTemplate.Core/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore.csproj", "src/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore/"]
COPY ["src/MyCompanyName.AbpZeroTemplate.GraphQL/MyCompanyName.AbpZeroTemplate.GraphQL.csproj", "src/MyCompanyName.AbpZeroTemplate.GraphQL/"]
RUN dotnet restore "src/MyCompanyName.AbpZeroTemplate.Web.Mvc/MyCompanyName.AbpZeroTemplate.Web.Mvc.csproj"
COPY . .
WORKDIR "/src/src/MyCompanyName.AbpZeroTemplate.Web.Mvc"
RUN dotnet build "MyCompanyName.AbpZeroTemplate.Web.Mvc.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MyCompanyName.AbpZeroTemplate.Web.Mvc.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MyCompanyName.AbpZeroTemplate.Web.Mvc.dll"]
